<h1>Editing code</h1>

<% form_for(@code) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </p>

  <p>
  	Private: 
  	<%= f.check_box :private %> 
  </p>

  <p>
    <%= f.label :shortdescription %><br />
    <%= f.text_field :shortdescription %>
  </p>

  <p>
    <%= f.label :description %><br />
    <%= f.text_area :description %>
  </p>	
  
  <p>
    <%= f.label :code_body %><br />
    <%= f.text_area :code_body %>
  </p>
  
  <p>
    <%= f.label :tag %><br />
    <%= f.text_field :tag %>
  </p>
  
  <p id="program_language_id">
  	Program Language<br />
	<%= select :code, :program_language_id, ProgramLanguage.find(:all).collect{|p| [p.language_name, p.id]} %>
  </p>
  
  <p id="category_id">
  	Category<br />
	<%= select :code, :category_id, Category.find(:all).collect{|c| [c.name, c.id]} %>
  </p>
  
  <input id="code_type_id" name="code[type_id]" type="hidden" value="1" />
  <p>
    <%= f.submit 'Update', :class => "default_button_class" %>
  </p>
<% end %>

<%= link_to 'Show', @code, :class => "default_button_class" %> |
<%= link_to 'Back', codes_path, :class => "default_button_class" %>
